All Questions
971 questions
-2votes
2answers
65views
In my controller's update action, when update_attributes fails due to the validator, I lose the /edit suffix in my URL
Description of my work environment: Rails 4.2.4, Ruby 2.3.1, SQL Server database, javascript on object html views My controller that content an update action: if @cs.update_attributes(...
0votes
1answer
36views
how put an id unique in a button in a rails loop?
I have a grid where the receipts are listed with their information and the display button. The idea is that pressing the button that appears in the actions column (button_tag) sends the information of ...
0votes
0answers
86views
Doc file download not working in rails 7 in windows. How to fix?
I want to download a custom doc file in rails 7. It is working in all machines, but not working in windows. I have created a button and a function named downloadDoc, after click on the button this ...
0votes
1answer
386views
Change the colors of chartkick stacked bar chart
I am using chartkick in my ruby on rails app and creating a stacked bar chart. I need to know how can I set my custom colors in this case. I am dividing the chart into 2 parts, male and female. I need ...
0votes
1answer
1kviews
How to use Sweet Alert to send ajax DELETE request in Rails?
Problem 1: When I click the link, the sweet alert modal pops up for a split second, disappears, and redirects to route. Not sure why the modal is only flashing when it should stay until option chosen. ...
0votes
1answer
123views
How to recognize Id attribute in rails form_tag?
I am using a form in rails to pass an id. That id will trigger the javascript Sweet Alert function which will pop up a modal with a confirmation message. When the message is confirmed "Yes" ...
0votes
0answers
137views
Bigdecimal value not converting to Integer value in Rails 4
I am working with my V2 API response on ruby on rails app. Currently when I hit my app on localhost:3000 it gets all the response as per provided. One of key is Percentage and its value is 56.3 but I ...
0votes
0answers
426views
Turbolinks are firing twice and causing duplicated script issue
I have upgraded rails version from 4.1.5 to 5.2.4.5. After upgrading turbolinks are firing multiple times and in JS console it's "duplicated script detected" appearing. I have run "rake ...
0votes
0answers
100views
Is there a way to access files that Rails has minified and compressed externally?
I know that the Rails asset pipeline will, under normal circumstances, minify and compress all JS files into one, making them smaller/obfuscated but impossible to access directly from another site. I ...
1vote
1answer
287views
execute javascript function after adding fields with cocoon
I'm developing my application in rails, in my app I'm extracting a form in a modal window through ajax, the form has a cocoon button to add nested records, the problem comes when adding new nested ...
0votes
0answers
610views
A single `remote: true` form tag will not generate requests as type: `js` in my rails app
Basically I can't get a form with remote: true to submit as an xhr request. It's been a long time since I've worked with a html.erb and js.erb based front end so I'm probably doing something dumb here ...
0votes
1answer
398views
How to access a java script variable in render partial url of Rails ERB file?
I have below piece of code in results.js.erb of Rails application where I need to render the partial URL dynamically using the string interpolation concept. I was unable to interpolate selector value ...
0votes
1answer
286views
Rails - include javascript tag with dynamic (per request) filename?
Inside of assets/javascripts/locales, I have a bunch of assets like: en-GB.js.erb en-CA.js.erb And so on. The locale will obviously change per request, so I am trying to include a JS tag like this: &...
0votes
0answers
248views
Rails Ajax - Javascript for DataTable is not working
I have a table where I want to delete entries via ajax. After the record is deleted the file destroy.js.erb will be executed and render the table via ajax in the DOM. This is working. But not the ...
-1votes
1answer
132views
How to disable server side validation of nested form in rails
I have given server side validation of nested form. each of that having model and in that given server side validation. But, main of that form of in model server side validation working of at the time ...